
#include "system_para.h"

static system_para_t  system_para;

int system_para_default(void)
{
	memset(&system_para,0,sizeof(system_para_t));

	system_para.audio_para.volume 	   = 3;	

	system_para.video_para.path        = 0;
	system_para.video_para.play_mode   = PLAY_MODE_RAND;
	system_para.video_para.de_time     = 0;
	system_para.video_para.play_index  = 1;

	return 0;
}

int system_para_config(void)
{
	if(system_para.video_para.path == 0)
	{
		system_para.video_para.play_mode   = PLAY_MODE_ALL_LOOP;
	}

	if(system_para.video_para.path == 1)
	{
		system_para.video_para.play_mode   = PLAY_MODE_RAND;
	}
	
	if(system_para.video_para.path == 2)
	{
		system_para.video_para.play_mode   = PLAY_MODE_RAND;
	}
	
	if(system_para.video_para.path == 3)
	{
		system_para.video_para.play_mode   = PLAY_MODE_RAND;
	}

	if(system_para.video_para.path == 4)
	{
		system_para.video_para.play_mode   = PLAY_MODE_RAND;
	}

	return 0;
}

int audio_para_set_volume(char volume)
{
	if(volume < MIN_VOLUME_VAL)
		return -1;
	
	if(volume > MAX_VOLUME_VAL)
		return -1;

	system_para.audio_para.volume = volume;	

	return 0;
}

char audio_para_get_volume(void)
{
	return system_para.audio_para.volume;
}


int video_para_set_path(char path)
{

	system_para.video_para.path = path;	

	return 0;
}

char video_para_get_path(void)
{
	return system_para.video_para.path ;
}

char video_para_get_playmode(void)
{
	return system_para.video_para.play_mode ;
}

int  video_para_set_detime(int de_time)
{
	system_para.video_para.de_time = de_time ;
	
	return 0;
}

int  video_para_get_detime(void)
{	
	return  system_para.video_para.de_time;
}

int  video_para_set_playindex(int index)
{
	system_para.video_para.play_index = index ;
	
	return 0;
}

int  video_para_get_playindex(void)
{	
	return  system_para.video_para.play_index;
}


